package br.com.felix.fwt.ui.javascript;

import br.com.felix.fwt.ui.BaseComponent;

/**
 * This class implements the code to hide a component with CSS and Javascript.
 * It simply alter the display property of a component to 'none'.
 * 
 * @author UP2F
 */
public class Hide extends Javascript {

	/** The javascript. */
	private String javascript;
	
	/**
	 * The Constructor.
	 * 
	 * @param component the component that will be hidden.
	 */
	public Hide(BaseComponent component){
		this.javascript = "document.getElementById('"+component.getName()+"').style.display = 'none'; ";
	}
	
	
	/**
	 * @see br.com.felix.fwt.ui.javascript.Javascript#script()
	 */
	@Override
	public String script() {
		return javascript;
	}

}
